<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>商户付款</title>
    <link rel="stylesheet" href="${ctxPath}/assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="${ctxPath}/assets/module/admin.css">
    <script src="https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js"></script>
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style type="text/css">
        html,
        body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            overflow: hidden;
        }
    </style>
    <style>
        .demo {
            margin: 1em 0;
            padding: 1em 1em 2em;
            background: #fff;
        }

        .demo h1 {
            padding-left: 8px;
            font-size: 24px;
            line-height: 1.2;
            border-left: 3px solid #108EE9;
        }

        .demo h1,
        .demo p {
            margin: 1em 0;
        }

        .demo .am-button + .am-button,
        .demo .btn + .btn,
        .demo .btn:first-child {
            margin-top: 10px;
        }

        .fn-hide {
            display: none !important;
        }

        input {
            display: block;
            padding: 4px 10px;
            margin: 10px 0;
            line-height: 28px;
            width: 100%;
            box-sizing: border-box;
        }
    </style>
</head>
<div class="aui-free-head">


</div>


<script>
    var pageWidth = window.innerWidth;
    var pageHeight = window.innerHeight;
    if (typeof pageWidth != "number") {
        //在标准模式下面
        if (document.compatMode == "CSS1Compat") {
            pageWidth = document.documentElement.clientWidth;
            pageHeight = document.documentElement.clientHeight;
        } else {
            pageWidth = document.body.clientWidth;
            pageHeight = window.body.clientHeight;
        }
    }
    $('body').height(pageHeight);
</script>
<script src="https://gw.alipayobjects.com/as/g/h5-lib/alipayjsapi/3.1.1/alipayjsapi.inc.min.js"></script>

<script>
    var tradeNo =('${tradeNo}');
    // AlipayJSBridge.call('closeWebview');
    // 导航栏loading
    AlipayJSBridge.call('showTitleLoading');

    // 副标题文字
    AlipayJSBridge.call('setTitle', {title: '自助充值', subtitle: '安全支付'});

    // 右上角菜单
    AlipayJSBridge.call('setOptionMenu', {
        icontype: 'filter',
        redDot: '-1', // -1表示不显示，0表示显示红点，1-99表示在红点上显示的数字
    });

    AlipayJSBridge.call('showOptionMenu');

    document.addEventListener('optionMenu', function (e) {
        AlipayJSBridge.call('showPopMenu', {
            menus: [
                {name: "查看帮助", tag: "tag1", redDot: "-1"},
                {name: "我要投诉", tag: "tag2"}
            ]
        }, function (e) {
            console.log(e);
        });
    }, false);

    function reloadPage() {
        history.go(0);
    }

    ready(function () {
        goAliPay();
    });

    function ready(a) {
        window.AlipayJSBridge ? a && a() : document.addEventListener("AlipayJSBridgeReady", a, !1)
    }

    function returnApp() {
        AlipayJSBridge.call("exitApp")
    }

    function goAliPay() {
        AlipayJSBridge.call("tradePay", {
            tradeNO: tradeNo
        }, function (result) {
            if (result.resultCode == 9000 || result.resultCode == "9000") {

            } else if ("6001" == result.resultCode) {

            } else if ("4000" == result.resultCode) {

            }
        });
    }
</script>
</html>

